package Lab1;

import java.util.Date;
import Lab1.ArrayExercises;

public class StopWatch {

    private long startTime;
    private long endTime;

    public StopWatch() {
        Date t = new Date();
        startTime = t.getTime();
        endTime = t.getTime();
    }

    public long getStartTime() {
        return startTime;
    }

    public long getEndTime() {
        return endTime;
    }

    public void start() {
        Date t = new Date();
        startTime = t.getTime();
    }

    public void stop() {
        Date t = new Date();
        endTime = t.getTime();
    }

    public long getElapsedTime() {
        return endTime - startTime;
    }

    
    public static void main(String[] agrs) {
        StopWatch w=new StopWatch();
        int[] a = ArrayExercises.randomArray(10000);
        ArrayExercises.selectionSort(a);
        
        w.stop();
        System.out.println(w.getElapsedTime());

    }
}
